// changeColumn.js
const pool = require('./index');

const changeUsernameToName = () => {
    const sql = `
        ALTER TABLE users 
        CHANGE username name VARCHAR(255) NOT NULL;
    `; // 使用 CHANGE 语句重命名列

    pool.query(sql, (err, results) => {
        if (err) {
            return console.error('Error renaming column:', err);
        }
        console.log('Column renamed successfully:', results);
    });
};

changeUsernameToName();